package com.zdxf.client.util;

import com.alibaba.fastjson.annotation.JSONType;

@JSONType(orders = {
        "code",
        "isSuccess",
        "message",
        "data"
})
public class Result {

    /**
     * 状态码
     */
    private Integer code;

    /**
     * 状态
     */
    private Boolean isSuccess;

    /**
     * 消息
     */
    private String message;

    /**
     * 数据对象
     */
    private Object data;

    /**
     * 无参构造器
     */
    public Result() {
        super();
    }

    /**
     * 只返回数据对象
     *
     * @param data
     */
    public Result(Object data) {
        super();
        this.data = data;
    }

    /**
     * 只返回状态，状态码，消息
     *
     * @param status
     * @param code
     * @param message
     */
    public Result(Boolean status, Integer code, String message) {
        super();
        this.isSuccess = status;
        this.code = code;
        this.message = message;
    }

    /**
     * 只返回状态，状态码，数据对象
     *
     * @param status
     * @param code
     * @param data
     */
    public Result(Boolean status, Integer code, Object data) {
        super();
        this.isSuccess = status;
        this.code = code;
        this.data = data;
    }

    /**
     * 返回全部信息即状态，状态码，消息，数据对象
     *
     * @param status
     * @param code
     * @param message
     * @param data
     */
    public Result(Boolean status, Integer code, String message, Object data) {
        super();
        this.isSuccess = status;
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Boolean getIsSuccess() {
        return isSuccess;
    }

    public void setIsSuccess(Boolean isSuccess) {
        this.isSuccess = isSuccess;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
